package com.zxl.grocery.microservice.auth.server.service;


import com.zxl.grocery.microservice.auth.server.vo.FrontUser;
import com.zxl.grocery.microservice.common.util.jwt.IJWTInfo;

/**
 * @Author: zxl
 * @Description: 用户与服务之间的鉴权
 * @Date: Created in 10:44 2017/10/14
 * @Modified By:
 */
public interface AuthService {

    /**
     * @Author: Lzx
     * @Description: 登录
     * @Params:  * @param null
     * @Date: 20:11 2017/10/14
     */
    String login(String username, String password) throws Exception;

    /**
     * @Author: Lzx
     * @Description: 刷新token接口
     * @Params:  * @param null
     * @Date: 20:12 2017/10/14
     */
    String refresh(String oldToken);

    /**
     * @Author: Lzx
     * @Description: 获取token中的存放的信息
     * @Params:  * @param null
     * @Date: 10:31 2017/10/19
     */
    IJWTInfo validate(String token) throws Exception;

    /**
     * @Author: Lzx
     * @Description: 获取用户信息
     * @Params:  * @param null
     * @Date: 20:26 2017/10/14
     */
    FrontUser getUserInfo(String token) throws Exception;

    Boolean invalid(String token);
}
